﻿using System;
using System.Web;

// ReSharper disable once CheckNamespace

namespace Web.Support
{
    public class Browser
    {
        public static Boolean IsSupport(HttpBrowserCapabilities requestBrowser)
        {
            var result = true;
            switch (requestBrowser.Browser)
            {
                case "IE":
                case "InternetExplorer":
                    if ((new Version(requestBrowser.Version)) < (new Version("9.0")))
                    {
                        result = false;
                    }
                    break;
                case "Chrome":
                    if ((new Version(requestBrowser.Version)) < (new Version("10.0.614")))
                    {
                        result = false;
                    }
                    break;
                case "FireFox":
                    if ((new Version(requestBrowser.Version)) < (new Version("3.6.13")))
                    {
                        result = false;
                    }
                    break;
                case "Safari":
                    if ((new Version(requestBrowser.Version)) < (new Version("5.0.3")))
                    {
                        result = false;
                    }
                    break;
                case "Opera":
                    if ((new Version(requestBrowser.Version)) < (new Version("10.0")))
                    {
                        result = false;
                    }
                    break;
            }
            return result;
        }
    }
}